This invention relates to a photoelectric switch with a corrective measure against noise, for example, from a fluorescent lamp of the inverter type. More in particular, this invention relates to such a photoelectric switch adapted to eliminate the effects of noise from a fluorescent lamp as much as possible, prior to an on-off judgment process for determining whether to switch on or off the switch, by adjusting received light detecting signals to a specified level as of a moment immediately before pulsed detection light is expected to arrive after being reflected by a target object.
As is well known, a photoelectric switch of this type is comprised of a light emitting means, a light receiving means and a signal processing means. In the case of a switch of the reflection type, the light emitting means and the light receiving means are generally disposed within a same housing. In the case of a switch of the transmission type, the light emitting means and the light receiving means are generally disposed in mutually separated housings.
The light emitting means includes a driving means for outputting a driving pulse signal (hereinafter referred to as the xe2x80x9cdriving pulsexe2x80x9d) at the timing specified by a light emission control signal and a light emitting element for emitting pulsed detection light to a target region in response to the driving pulse outputted from the driving means. The light receiving means includes a light receiving element for receiving the pulsed detection light arriving from the target area and an amplifier for generating the output from the light receiving element to generate a light detection signal. The signal processing means serves to output the result of the on-off judgment process. The on-off judgment process (or xe2x80x9con-off judgmentxe2x80x9d) is the process whereby it is determined whether to switch on or off the switch, depending on whether or not a target object is found to be present in the target region.
FIG. 12 shows an example of waveform diagram of the driving pulse PD and light detection signal VS2. The driving pulse PD is a rectangular wave with peaks appearing at regular timing intervals T. The light detection signal VS2 has a typical hill-shaped waveform, rising suddenly to reach a peak pk during a period between points of time corresponding to the front and back edges of the driving pulse PD, dropping quickly and overshooting to reach a bottom bm and thereafter gradually returning to the zero-level. The causes of the overshooting portion include the capacitance of the amplifier of the light receiving means.
If the base level of the hill-shaped waveform of the light receiving signal VS2 were always as stable as shown in FIG. 12, a reliable on-off judgment would be possible by sampling the light receiving signal VS2 at a timing with a slight delay from that of the driving pulse PD and comparing the level of the sampled light receiving signal VS2 with a specified threshold value.
FIG. 13 shows an example of driving pulse PD, the range xcex94T of variations in the timing for the generation of sampling pulse PS and the noise component VN2 due to an inverter fluorescent lamp.
Photoelectric switches of this type have typically a light emission period T which is relatively close to the on-off period of inverter type fluorescent lamps commonly used for illumination at factories in Europe. If a photoelectric switch of this type is installed in an environment where such fluorescent lamps are employed, the light receiving signal VS2 as shown in FIG. 12 and the noise component VN2 of the fluorescent lamps will be superposed. As a result, the base level of the hill-shaped waveform of the light receiving signal VS2 varies from one period to another, and a reliable on-off judgment will not be possible by a simple method of comparing a threshold value with the level of the light receiving signal VS2 at a timing with a delay of a specified time length from that of the driving pulse PD.
Even in the absence of noise component VN2 in the fluorescent lamps, it is difficult to completely suppress the variations in the timing for the generation of sampling pulse PS by means of the capacitance of circuit elements because it cannot be avoided to determine the timing for the generation of sampling pulse PS on the basis of the timing for the generation of the driving pulse PD. In the case of a switch of the transmission type, in particular, the driving pulse PD is transmitted from the light receiving device to the light emitting device through a communicating means and the range of variation xcex94T is not negligible because of the variations in the transmission time for this communication.
In view of the above, the present inventors proposed a procedure whereby the level of the light receiving signal is shifted towards the specified level by an amount corresponding to the difference between the level of the light receiving signal at the moment immediately before the pulsed detection signal is expected to arrive and the specified level during the period in which the detection signal waveform of the pulsed detection light is expected to be obtained and it is determined whether at least one of the conditions to be used for an on-off judgment is satisfied on the basis of the level of the light receiving signal after it has thus been shifted.
By such a signal processing method, it was expected that the effects of noise components from a fluorescent lamp would be eliminated and a reliable on-off judgment would be possible because use is made of an algorithm whereby a comparison with the threshold level is made only after noise components are removed from the level of the light detection signal. After a diligent investigation by the present inventors, however, it has been discovered that problems still remain with the reliability of the on-off judgment results even with such a signal processing method with a routine for removing noise components as described above.
One of the reasons for this is that it is difficult to accurately estimate the timing immediately before the pulsed detection signal is expected to arrive. In the case of a photoelectric switch of the transmission type, in particular, since the driving pulse PD is transmitted from the light emitting device to the light receiving device through a communicating means, it is not possible to accurately estimate the expected arrival time of the pulsed detection signal because of the variations in the time of transmission by this communication means. If there is a large variation in the arrival time of the pulsed detection signal, an accurate on-off judgment is not possible no matter how adequate the threshold value used for the judgment is.
Another reason is that, even if the timing for the arrival of the pulsed detection signal could be accurately determined, an accurate on-off judgment would still be impossible. It is because, if the timing thus determined happens to coincide with a portion of the waveform of the noise component VN2 from the fluorescent lamp where the waveform is changing rapidly (such as at phase 0xc2x0, 180xc2x0 and 360xc2x0) and if the light detection level of the pulsed detection light happens to be near (either above or below) the threshold value for the judgment, the light detection signal level may erroneously exceed or fail to exceed the threshold value due to the effects of noise component VN2.
The present invention is for solving such problems of photoelectric switches with such a level shifting function.
It is an object of this invention to provide a photoelectric switch with a level shifting function having a more reliable on-off judgment capability.
It is another object of this invention to provide such a photoelectric switch which is reliable even when the timing for the sampling of detection signal necessary for the on-off judgment is somewhat displaced.
It is a further object of this invention to provide such a photoelectric switch which is reliable even when the sampling timing for detection signal happens to coincide with a rapidly changing portion of the waveform of the detection signal caused by a noise component.
A photoelectric switch embodying this invention, with which the above and other objects can be accomplished, comprises a light emitting means for periodically emitting pulsed detection light, a light receiving means for photoelectrically converting the pulsed detection light and thereby outputting corresponding light detection signals, and a signal processing means for generating an on-off judgment output for switching on or off this photoelectric switch. The signal processing means includes a level shifting means for shifting the level of the light detection signals towards a specified level at least during a specified light receiving period by an amount corresponding to the difference between the specified level and the level of the light detection signal at a time immediately before the pulsed detection light is expected to arrive, and a condition judging means for judging, on the basis of the light detection signal with the level shifted by the level shifting means, whether or not at least one of conditions to be used for generating the on-off judgment output is satisfied.
According to an embodiment of the invention, the condition judging means serves to generate the on-off judgment output at least on the condition that the levels of the light detection signal at a first timing when a peak of the light detection signal is expected to arrive and at a second timing when a bottom of the light detection signal after an overshoot period is expected to arrive are in a specified size relationship. A reliable on-off judgment is possible according to this embodiment because even if the first and second timings are somewhat displaced from the peak or bottom of the waveform of the detection signal, the size relationship being examined is hardly affected. Thus, the expressions xe2x80x9cfirst timingxe2x80x9d and xe2x80x9csecond timingxe2x80x9d used herein should be interpreted broadly. They are not required to coincide accurately with the peak or bottom of the waveform of the detection signal.
According to a more preferred embodiment, the condition judging means serves to generate the on-off judging output additionally on the condition that the level of the light detection signal at the first timing and the specified level is in a specified size relationship.
According to a second embodiment of the invention, the light emitting means is controlled to emit light at least three times per period of light emission from an inverter fluorescent lamp in the environment of the photoelectric switch. The condition judging means compares a specified level and the level of the light detection signal at times when a peak of the pulsed detection light is expected to arrive, generating the on-off judgment output according to the majority of the comparison results obtained within a period of light emission from the fluorescent lamp.